package com.xzit.rcpyxt.controller;

import com.xzit.rcpyxt.constant.MessageCode;
import com.xzit.rcpyxt.dto.ResultModel;
import com.xzit.rcpyxt.dto.TeacherDto;
import com.xzit.rcpyxt.dto.TeacherListRequestDto;
import com.xzit.rcpyxt.entity.Teacher;
import com.xzit.rcpyxt.service.TeacherService;
import com.xzit.rcpyxt.utils.PageUtil;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/*
Controller标记的类就是一个控制器，这个类中的方法，就是相应的动作
 */
@RestController
@RequestMapping(value = "/teacher")
public class TeacherController {

    @Autowired
    private TeacherService teacherService;

    /**
     * 老师绑定列表
     * @param teacherDto
     * @return
     */
    @ApiOperation(value = "老师绑定列表")
    @RequestMapping(value = "/findTeacherList", method = RequestMethod.GET)
    public ResultModel findByTeacherList(TeacherListRequestDto teacherDto) {
        PageUtil teacherList = teacherService.findByTeacherList(teacherDto);
        return new ResultModel(MessageCode.OK, teacherList);
    }

}